package com.project.zsxd.server.user.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.project.zsxd.server.common.exception.SystemException;
import com.project.zsxd.server.user.dto.UserDTO;
import com.project.zsxd.server.user.entity.User;
import com.project.zsxd.server.user.vo.UserVO;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author kaler
 * @since 2020-05-12
 */
public interface IUserService extends IService<User> {

    /**
     * 转换List<User>到List<UserVO>
     * @param userList
     * @return
     */
    List<UserVO> castToVOList(List<User> userList) throws SystemException;

    /**
     * 根据
     * @param userName
     * @return
     * @throws SystemException
     */
    List<String> queryRolesByUserName(String userName);

    /**
     * 根据
     * @param userName
     * @return
     * @throws SystemException
     */
    List<String> queryPermissionsByUserName(String userName);

    /**
     * 注册外部用户
     * @param newUser
     * @return
     */
    User registerOpenUser(User newUser) throws SystemException;

    /**
     * 根据openId查询用户信息
     * @param openId
     * @return
     */
    User queryByOpenId(String openId);
}
